Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RegisterAsyncJsObject managed methods can now return arrays of structs #1981

Merged
merged 4 commits into from
Mar 13, 2017

Conversation

joaompneves
Copy link
Contributor

@joaompneves joaompneves commented Mar 9, 2017

Problem:
It was not possible to call .Net methods from JS that return arrays of structs.

Fix:
IsComplexType from JavascriptObjectRepository returns false for arrays.

Notes:
This PR requires 1979

@amaitland
Copy link
Member

Make it happen :)

A technical description please

This PR also contains #1979, please either only include the changes relevant to this fix or add all the relevant technical details to this PR please.

@@ -33,5 +37,12 @@ public void DoSomething()
{
Thread.Sleep(1000);
}

public JsObject[] ObjectArray(string name) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting please, braces on `new lines, be consistent with other

@@ -8,6 +8,10 @@

namespace CefSharp.Example
{
public struct JsObject {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brace on new line please

@@ -82,11 +82,21 @@
writeAsyncResult(call, end);
});
}

function asyncObjectArray() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Braces on new lines


asyncError();
asyncDivOk();
asyncDivFail();
asyncDoSomething();
asyncHello();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an asyncHello method?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

@joaompneves joaompneves changed the title Support js binding struct arrays Allow calling managed methods from objects bound with RegisterAsyncJsObject that return arrays of structs Mar 10, 2017
@amaitland amaitland added this to the 57.0.0 milestone Mar 13, 2017
@amaitland amaitland merged commit bc83d6c into cefsharp:master Mar 13, 2017
@amaitland amaitland changed the title Allow calling managed methods from objects bound with RegisterAsyncJsObject that return arrays of structs RegisterAsyncJsObject managed methods can now return arrays of structs Mar 13, 2017
@joaompneves joaompneves deleted the SupportJSBindingStructArrays branch December 26, 2017 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants